import Vue from 'vue'
import Router from 'vue-router'
import Home from 'components/home/home'
import HealthList from 'components/healthList/healthList'
import Expert from 'components/expert/expert'
import News from 'components/news/news'
import NewsDetail from 'components/newsDetail/newsDetail'
import User from 'components/user/user'
import HealthListDetail from 'components/healthListDetail/healthListDetail'
import HealthInput from 'components/healthInput/healthInput'
import Order from 'components/order/order'
import OrderDetail from 'components/orderDetail/orderDetail'
import Archive from 'components/archive/archive'
import Report from 'components/report/report'
import Proposal from 'components/proposal/proposal'
import CenterDetail from 'components/centerDetail/centerDetail'


Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    {
      path: '/home',
      component: Home,
      meta: {
        title: '博济体检'
      },
      children: [
        {
          path: 'centerDetail',
          component: CenterDetail,
          meta: {
            title: '中心介绍'
          }
        },
        {
          path: ':newsId',
          component: NewsDetail,
        }
      ]
    },
    {
      path: '/healthList',
      component: HealthList,
      meta: {
        title: '套餐列表'
      },
      children: [
        {
          path: ':id',
          component: HealthListDetail,
          children: [
            {
              path: 'input',
              component: HealthInput,
            }
          ]
        }
      ]
    },
    {
      path: '/expert',
      component: Expert,
      meta: {
        title: '专家介绍'
      }
    },
    {
      path: '/user',
      component: User,
      meta: {
        title: '个人中心'
      },
      children: [
        {
          path: 'order',
          component: Order,
          meta: {
            title: '我的订单'
          },
          children: [
            {
              path: ':orderId',
              component: OrderDetail
            }
          ]
        },
        {
          path: 'archive',
          component: Archive,
          meta: {
            title: '我的档案'
          }
        },
        {
          path: 'report',
          component: Report,
          meta: {
            title: '我的报告'
          }
        },
        {
          path: 'proposal',
          component: Proposal,
          meta: {
            title: '意见反馈'
          }
        },
      ]
    },
    {
      path: '/news',
      component: News,
      meta: {
        title: '新闻资讯'
      },
      children: [
        {
          path: ':newsId',
          component: NewsDetail,
        }
      ]
    }
  ]
})
